#include <errno.h>

static inline int number_of_trials(int pid) {
long __res;
__asm__ volatile (

"movl $245, %%eax;\n\t"
"movl %1, %%ebx;\n\t"
"int $0x80;\n\t"
"movl %%eax,%0\n\t"

/* outputs */
: "=m" (__res)

/* inputs */
: "m" (pid)

/* clobbered regiters */
: "%eax","%ebx"
);

if ((unsigned long)(__res) >= (unsigned long)(-125)) {
errno = -(__res);
__res = -1;
}

return (int)(__res);
}

static inline int mq_time_slice(int pid) {
long __res;
__asm__ volatile (

"movl $246, %%eax;\n\t"
"movl %1, %%ebx;\n\t"
"int $0x80;\n\t"
"movl %%eax,%0\n\t"

/* outputs */
: "=m" (__res)

/* inputs */
: "m" (pid)

/* clobbered regiters */
: "%eax","%ebx"
);

if ((unsigned long)(__res) >= (unsigned long)(-125)) {
errno = -(__res);
__res = -1;
}

return (int)(__res);
}



static inline int is_mq(int pid) {
long __res;
__asm__ volatile (

"movl $244, %%eax;\n\t"
"movl %1, %%ebx;\n\t"
"int $0x80;\n\t"
"movl %%eax,%0\n\t"

/* outputs */
: "=m" (__res)

/* inputs */
: "m" (pid)

/* clobbered regiters */
: "%eax","%ebx"
);
}
